//引用练习

fn main() {
    let mut s = 4;
    match s {
        ref mut val => {
            //使用引用,必须解引用才能进行操作
            *val += 10;
            println!("ref mut s:{:?}", val);
        }
    }
    println!("s:{:?}", s);
    //闭包
    let f = |value: &mut i32, value2: &mut i32| {
        *value += 4;
        *value * *value2
    };
    let mut v = 10;
    let mut v2 = 200;
    println!("{:?}", f(&mut v, &mut v2));

    let value = Box::new(vec![10]);
    println!("{:?}", value);

    let v3 = 10;
    let v4 = &v3;
    println!("{},{}", v3, v4);
}
